package com.ccsoft.atools.controller;

import com.ccsoft.atools.model.Vue3menuNode;
import com.ccsoft.atools.service.Vue3menuService;
import com.ccsoft.atools.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/vue3menu")
public class Vue3menuController {
    @Autowired
    private Vue3menuService service;

    @GetMapping("/tree")
    public JsonResult buildNode() {
        return JsonResult.ok(service.buildNode());
    }

    @GetMapping("/menus")
    public JsonResult buildMenus() {
        return JsonResult.ok(service.buildMenus());
    }

    @PostMapping("/list")
    public JsonResult buildMenusWithChildren() {
        return JsonResult.ok(service.buildMenus());
    }
}
